<div id="blogNewComment" class="blogNewComment">
	
	<script>
		function sblank() {
			var el = document.getElementById('blog_comment_body')
		//	el.value = '';
		}
		
		function hide() {
			$('#insert_comment').hide();			
			$('#loading').show();
		}
		
	</script>
	
	<% if !logged_in? %>
		<h2><%=t(:login_to_post_comment)%></h2>
	<% else %>
		<h2><%=t(:insert_comment)%></h2>
		<% if current_user %>
			<p>Stai scrivendo come <span class="blogPoster"><%= current_user.name %></span></p>
		<% end %>
		<% remote_form_for([@blog, @blog_post, blog_comment], 					
			:after => "sblank()") do |f| %>
			<%= error_messages_for :blog_comment, :header_message => nil, :message => "Impossibile inserire il commento" %>
						
			<p>
				<%= f.label :body, 'Commento' %><br />
				<%= f.text_area :body, :class => 'blogNewCommentField' %>
			</p>
			<p>
				<%= f.submit 'Inserisci commento', :id => 'insert_comment', :onclick => "hide();"	 %>
				<%= image_tag "spinner.gif", :style => 'display: none;', :id => 'loading' %>
			</p>
		<% end %>
	<% end %>
</div>